<?php


namespace app\admin\controller;


class Test extends Common
{
    // 用户所有消费
    public function index()
    {

        $data = model('user')
            ->where('a.id','=','195')
            ->alias('a')
            ->join('moneyShopping b','a.id = b.us_id ')
            ->join('moneyTeam c','a.id = c.us_id ')
            ->join('moneyTixian d','a.id = d.us_id ')->where('d.gong_tx_s','=',null)
            ->select();

        halt($data);








    }

    public function duo()
    {
        $id = 196;
        $data = model('user')->where('id',$id)->field('id')->select();
        foreach ($data as $k =>$v ){
            $data[$k]['money'] = model('MoneyShopping')->whereIn('us_id',$v['id'])->select();
        }
        halt($data);



    }

}